<% if @projects.empty? %>
    You have no projects
<% else %>
    <%= form_for(@team, :html => {:class => 'form-horizontal', :multipart => true, :data => {:abide => true}}) do |f| %>
        <div class="form-content form-below">
          <%= build_validated_field('team', 'name', 'Name', 'Cannot be blank', '[a-zA-Z]+', 'text', @team.name) %>
          <%= build_validated_field('team', 'code', 'Code', 'Cannot be blank', '[a-zA-Z]+', 'text', @team.code) %>
          <%= build_field('team', 'description', 'Description', 'text_area', @team.description) %>
          <div class='form-row'>
            <div class='small-3 columns'>
              <%= f.label :project_id, "Department" %>
            </div>
            <div class='small-9 columns'>
              <%= f.select :project_id, @projects.map { |x| [x.name, x.id] } %>
            </div>
          </div>


          <div class='form-row'>
            <div class='small-3 columns'>
              <%= f.label :team_lead_ids, 'Team leads' %>
            </div>
            <div class='small-9 columns'>
              <%= f.select :team_lead_ids, @users.map { |x| [x.name, x.id] }, {}, {:multiple => true} %>
            </div>
          </div>

          <%#= build_validated_field('team', 'is_deleted', 'Deleted', 'Cannot be blank', '[a-zA-Z]+', 'checkbox', @team.is_deleted) %>
          <%#= build_field('team', 'members_count', 'Teams count', 'text', @team.members_count) %>
          <%#= build_field('team', 'managers_count', 'Members count', 'text', @team.managers_count) %>
        </div>
        <div class="small-12 columns form-action-up">
          <div class="title">Team</div>
          <div class="right">
            <%= f.submit 'Save', :class => 'button alert right' %>
            <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                        teams_path, :class => 'btn cancel-btn' %>
          </div>
        </div>
    <% end %>
<% end %>
<script type="text/javascript">
    window.location = '#pane3'
</script>


